Imports System
Imports System.Xml

Public Enum RptSides
	Buy = 1
	Sell = 2
End Enum

Public Class ReportSide
	'            <RptSide Side="1">
	'                  <Pty R="24" ID="ABNACCT1"/>
	'                  <Pty R="4" ID="444"/>
	'                  <Pty R="12" ID="jjbrady"/>
	'            </RptSide>
	Protected m_side As RptSides
	Protected m_customer As String
	Protected m_clearing As String
	Protected m_trader As String

#Region "Properties"

	Public Property Side() As RptSides
		Get
			Return m_side
		End Get
		Set(ByVal Value As RptSides)
			m_side = Value
		End Set
	End Property

	Public Property CustomerID() As String
		Get
			Return m_customer
		End Get
		Set(ByVal Value As String)
			m_customer = Value
		End Set
	End Property

	Public Property ClearingID() As String
		Get
			Return m_clearing
		End Get
		Set(ByVal Value As String)
			m_clearing = Value
		End Set
	End Property

	Public Property TraderID() As String
		Get
			Return m_trader
		End Get
		Set(ByVal Value As String)
			m_trader = Value
		End Set
	End Property
#End Region

	Public Sub New()

	End Sub

	Public Sub New(ByVal rptside As RptSides)
		Side = rptside
	End Sub

	Public Function BuildXML(ByRef XmlW As XmlTextWriter) As Boolean
		'            <RptSide Side="1">
		'                  <Pty R="24" ID="ABNACCT1"/>
		'                  <Pty R="4" ID="444"/>
		'                  <Pty R="12" ID="jjbrady"/>
        '            </RptSide>
        XmlW.WriteStartElement("RptSide")
		XmlW.WriteAttributeString("Side", Side.GetHashCode.ToString)

		XmlW.WriteStartElement("Pty")
		XmlW.WriteAttributeString("R", "24")
		XmlW.WriteAttributeString("ID", CustomerID)
		XmlW.WriteEndElement()

		XmlW.WriteStartElement("Pty")
		XmlW.WriteAttributeString("R", "4")
		XmlW.WriteAttributeString("ID", ClearingID)
		XmlW.WriteEndElement()

		XmlW.WriteStartElement("Pty")
		XmlW.WriteAttributeString("R", "12")
		XmlW.WriteAttributeString("ID", TraderID)
		XmlW.WriteEndElement()

		XmlW.WriteEndElement()		 ' RptSide

	End Function

End Class
